<template>
	<view>
		<view class="dhl" :style="background"></view>
		<view class="topbar box dis_f_c_c" :style="background">
				{{title}}
		<image  class="top_jt" :src="src" mode="aspectFit" @click="go_back"></image>
		</view>
	</view>
</template>

<script>
	
	export default {
		props:{
			title:{
				type:String,
				default:'name',			
			},
			jt_c:{
				type:String,
				default:'1',			
			},
			background:{
				type:String,
				default:'',			
			}
		},
		data() {
			return {
				// 公用的js
				$: this.$,
				src:'',
			}
		},
		mounted() {
			if(this.jt_c ==1){
				this.src = '../../static/icon/back.png'
			}
			if(this.jt_c ==2){
				this.src = '../../static/icon/back2.png'
			}
			if(this.jt_c ==3){
				this.src = ''
			}
		},
		methods: {
			// 返回
			go_back() {
				this.$.back()
			},
		},
		
	}
</script>

<style lang="scss">
	.dhl {
		// position: absolute;
		width: 100%;
		height: var(--status-bar-height);
		position: fixed;
		top: 0;
		z-index: 999;
	}
	.topbar {
		width: 100%;
		z-index: 999;
		height: 88rpx;
		position: fixed;
		top: var(--status-bar-height);
		font-size: 34rpx;
		color: #212730;
		font-weight: bold;
		// background-image: url(../../static/index/bg.png);
		// padding: 0 0 26rpx 0rpx;
		
		.top_jt {
			width: 18rpx;
			height: 32rpx;
			position: absolute;
			left: 40rpx;
			top: 28rpx;
		}
	}
</style>
